import java.util.Scanner;


/**
 * This program demonstrates a <code>while</code> loop.
 * @author andy
 */
public class Retirement {

  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);

    print("How much money do you need to retire? ");
    double goal = in.nextDouble();

    print("How much money do you contribute every year? ");
    double payment = in.nextDouble();

    print("Interest rate in %: ");
    double interestRate = in.nextDouble();

    int years = 0;
    double balance = 0;

    while (balance < goal) {
      balance += payment;
      balance += balance * interestRate / 100;
      years++;
    }

    String result = String.format("You can retire in %d years.\n", years);
    print(result);
  }

  public static void print(String msg) {
    System.out.print(msg);
  }

}
